using System;
using System.Collections.Generic;
using System.Text;

namespace Decav.Collections
{
    /// <summary>
    /// Interfaces a collection that is transactional in nature.
    /// </summary>
    public interface ITransactionalCollection<T>
    {
        /// <summary>
        /// Gets if there are any changes that have not been committed to the underlying
        /// collection.
        /// </summary>
        bool HasChanges
        {
            get;
        }

        /// <summary>
        /// Commits the changes made to the collection to the underlying collection.
        /// </summary>
        void CommitChanges();

        /// <summary>
        /// Rolls back the changes made to the collection
        /// so they weill never be committed to the underlying collection, and restores
        /// the collection to the state of the underlying collection.
        /// </summary>
        void RollbackChanges();
    }
}
